package com.bs.bszhsq.mapper;

import com.bs.bszhsq.entity.Discusss;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 社区信息评论表 Mapper 接口
 * </p>
 *
 * @author 章宇光
 * @since 2024-04-23
 */
public interface DiscusssMapper extends BaseMapper<Discusss> {

    @Select("SELECT c.*,u.username FROM discusss c LEFT JOIN users u ON c.userid=u.id WHERE c.forum_id=#{forumId} order by addtime desc")
    List<Discusss> getDiscysss(@Param("forumId") Long forumId);
}
